In general, the neutral and ground sides of most 120 volt AC system are not switched anywhere in the system.
A transfer switch that switches between shore power and on board generator power should connect the neutral and ground together for generator power. This is called "bonding".
Shore power systems require a ground to neutral connection as well as an earth ground at or near the main service entrance.
An on board generator requires a neutral to system ground bond at or near the generator. (Earth ground is usually not required.)
Only one neutral to ground bond is allowed in any system at one time. For this reason the transfer switch bonds neutral to ground when it switches to on board generator. It disconnects the bond when it switches to shore power.
RV systems using portable generators require a bond between neutral and the ground system at or near the generator. It must be removed when RV is connected to shore power. (Earth ground is usually not required.)
These wiring code rules have been established over the last 150 years based on experience, accidents involving people and animals, and property damage.
I wish you good luck and happy trails ahead.