Yes. It is called s
DOUBLE POLE
DOUBLE THROW
120 vac relay.
When the generator is used, the now energized 120 volt magnetic coil pulls the contact lever off of the NC normally closed hot and neutral contacts and pulls them onto the hot and neutral normally open contacts.
Forget about 220 vac power. It is useless until voltage is dropped to 110 volts.
And THAT requires a buck/boost transformer. There is no avoiding putting a transformer in circuit if you intend to do this. The transformer goes into the circuit FIRST THING after the plug and cord. Meaning before the relay.
So you need two things...
A properly sized 240/120 transformer
A properly sized DPDT relay