I think you got the hang of it. Like my tamagotchis are both in gen 2 right now. So their parents are gen 1.
So if my tamagotchis have babies, the babies would be gen 3 and their parents would be gen 2 and the first tamas would be gen 1 and grandparents.