The explained circuit will effectively switch the connected appliances to the generator mains during power failure however it won't be able to switch start the generator automatically, this will need to be done manually, because most generators involve a difficult mechanical actuation procedure.
Referring to the given diagram we can see a simple circuit comprising of a TP relay (triple pole relay) and an transformerless power supply circuit.
The input of the transformerless power supply circuit is connected to the mains 220V or 120V input.
When mains power is present, the connected relay activates with this power and switches ON the load or the appliances via its N/O contacts.
Conversely when mains power fails, the relay deactivates and connects with the N/C contacts which may be wired up with the generator mains.
Now as soon as the generator is pulled started, the mains finds its way through the connected N/O contacts of the relay to the appliances.
The third set of contacts is used for enabling and disabling of the CDI unit of the generator so that when mains is restored, the generator is automatically halted.
Simple yet effective.....