The Mainz Anonymous reads, in part (in my own translation):
He created the Torah 974 generations before the world was created, then twenty-six generations [passed] from the creation of the world until Moshe, the leader of the prophets, through whom the Torah was given.
(I'm quoting from the MA in light of this week's topic challenge. In fact, though, there are older sources for this idea, though I'm not sure where.)
Obviously, the midrash paraphrased here is not to be taken literally: specifically, without anyone's having children, there are no generations; and perhaps time did not even elapse (not being created) before the creation of the world. (On the other hand, perhaps it did.) In any event, my question is why the midrash uses generations instead of a more conventional unit of time (such as years).
An initial idea toward a possible answer: Note that Moshe had contemporaries, even Jewish ones, who were more or fewer than twenty-six male-line generations from the creation of the world. For example, Nachshon was twenty-eight generations. So "twenty-six generations" makes sense only if one refers specifically to Moshe, rather then generally to his time. Perhaps, then, generations are not being used as a unit of time at all but as a unit of succession or something like that.