There is no direct story connection between Naruto Ultimate Ninja Storm Generations and Naruto Shippuden: Ultimate Ninja Storm 2.
Storm 2 tells its own full story arc, while Generations is more of a compilation that revisits and celebrates moments from across the Storm series. Think of Generations as a retrospective gathering of the games rather than a continuation of Storm 2's plot.