I don't know for all the regions, but for Gen 8 Sword and Shield, the egg values (including whether or not it is shiny) are determined when the nursery worker folds her arms to indicate she has an egg. For the roamers, (the Galarian Birds) it is determined when you encounter them, so you can keep resetting and catching till you get the best IVs/Nature that you want. Hope I helped! :D
NOTE: This isn't an answer because you asked for all the generations, and this is just Sword and Shield, but still :)