Generations do have voting habits though
What you mean to say is simply that environment influences behavior. "Generations" are just arbitrary buckets that reinforce stereotypes and create division. A young gen x person likely has a lot more in common with an old millennial than an old gen x person.
https://www.washingtonpost.com/opinions/2021/07/07/generation-labels-mean-nothing-retire-them/
https://www.newyorker.com/magazine/2021/10/18/its-time-to-stop-talking-about-generations