The transfer switches from shore power to generator and back the other way. Depending upon which one you are using the other one is switched out of the system.
Say you are hooked to shore power and the power goes off. You'd switch to generator and a short time later the shore power returns. You can't use both at the same time so the generator will continue to run but its output will be switched out and you'll be back on shore power.
Same as if you're on shore power and decide it's time to exercise the generator. With the switch you won't have to disconnect from shore power to run the generator but the generator won't be under load.
Basically, the switch allows you to use only one power source at a time.
The positive way to find out which wire is which would be to trace the wire to its point of origin. The out going wires will go to the converter and points beyond.
2013 Voltage 3800, 2012 Chevy 3500 HD
2010 Yamaha V Star 950
2009 Yamaha Raider
Volunteering with Habitat for Humanity Caravanners