First off, welcome to the forums!
Your description is confusing to me. Here's a simple diagram of how the transfer switch is wired. Yours may be slightly different as the Montana Legacy trailers have a few more bells and whistles than the High Country. But the principle is still the same.
As BibBobIa stated above, your transfer switch receives power from two sources: Shore power AC and the battery. Under normal conditions, when plugged into shore power, the AC power passes through the transfer switch. When shore power is disconnected, the transfer switch will flip it's source to the battery. But, before that, that power source has already passed through your inverter.
Study out this diagram, it should help you.
Also... welcome to the forums and I hope you are enjoying that Montana! You may also want to join the
Montana Owners Club Forums. Between the Keystone Forum with a wealth of information about Keystone products in general, and the Montana forum that is specific for us Montana owners, you have a massive wealth of information and resources available to you.
Again, welcome to the forums!