shit changes all the time, so the definition of a console generation is not properly defined and therefore malleable.
That said, NES was Gen 3, SNES was Gen 4, N64 was Gen 5, Gamecube was Gen 6, Wii was Gen 7, and WiiU was Gen 8. Switch, PS5, and Xbox One are all currently on the market as Gen 9. At least that's how I see it and how my game database categorizes it. We'll reconvene when the next Nintendo console/platform releases. Until then, Switch is Gen 9 in my eyes.
My Console Library:
PS5, Switch, XSX
PS4, PS3, PS2, PS1, WiiU, Wii, GCN, N64 SNES, XBO, 360
3DS, DS, GBA, Vita, PSP, Android