What you are looking for is called a transfer switch. The way in which you propose to do it seems dangerous. If one of the switches is in the wrong position, it will backfeed the transformer and endanger utility personnel. The second problem (I may be wrong about this) is that the device still needs overcurrent protection on the load side. That is to say, you don't want the generator to keep pumping juice into a fault condition and there is nothing to stop it. I think if you look online for automatic transfer switches and related products you'll find what you need. It may incur a bit of an expense, but the prices are reasonable and safer than jerryrigging something together.