I don't think this has been mentioned but an inexpensive alternative to a transfer switch is an interlocking breaker.

The breaker for the generator goes at the top of the panel and has a mechanism that will not allow it to close until the main breaker is open.