Hi, you could use either as part of a sentence:
‘She cared after (or for) several generations/generation after generation of the family’
What sounds better depends on what you want the emphasis to be. The second makes it sound like a very long term commitment - ‘generation after generation’ is stronger than ‘several generations’ in emphasising the length of time involved. The first sounds more natural however, less like hyperbole.