Use a double pole double throw transfer switch and it will be a non issue. If you transfer both the neutral and the hot the generator functions as a derived system. The easiest way to provide grounding will depend on how your generator is configured. If its neutral is bonded to the frame then you will need to run a Grounding Electrode Conductor (GEC) from your house's grounding electrode system to the bonding lug on your generator. If the generator neutral is not bonded to the generator frame then it will be easier to bond the neutral to ground in the transfer switch and run the GEC to the grounding electrode system from the switch's enclosure.
"This alternating current stuff is just a fad. It is much too dangerous for general use" Thomas Alva Edison