Why can't you just have a secondary box next to the panel that has 2 contactors that close (one opens) on supply failure and feeds only the essential circuits of any given house and a male inlet on the outside of the building, to connect the generator to?
When the supply is re-instated the contactors revert to their "normal" state.