Cited as a reference · for some experience
Automatic generator changeover switch (with schematic).
Why people recommend it
Cited as a look at a ready-made automatic transfer switch for changing between mains and generator, and as an example of the usual approach.
Watch for: Involves mains wiring, so take proper care