I don't know for sure, but I don't think there's any way to connect your generator's inverter to your trailer's battery. I know there's no way to do it on my Honda generator. My inverter generator is NOT a 2-way device. It only SENDS current to the trailer and/or battery.
If you want to run a CPAP from your trailer's battery, you'll need one that has an output Wattage that is somewhat more than what the CPAP is rated at. I'm no expert on this, so someone else might correct me, but I'd aim for something that has about 20% more capacity than the CPAP needs. This should keep the inverter running at a comfortable level. I think if you're very near the inverter's limit it might overheat and shut down.
With that Wattage pull, will your battery(s) last all night? What is the Watt rating of your CPAP machine? Watts are Volts x Amps. So since your battery will probably be around 12.5V under this demand, if the CPAP needed 200 Watts, you would be pulling 16 Amps from the battery to supply this demand. That's a very LARGE draw! I know the CPAP uses 120 Volts, but the Wattage is a constant. 12.5V DC and 16A would be converted to 120V AC and 1.67A to supply the 200 Watts needed. Forgive me, please, if I'm telling your things you already know - I'm just trying to keep you from being disappointed. Hopefully, the CPAP uses less Wattage, and you can figure out how you stand from that.
- Jack