Alas it's pretty much up to you.
Ideally all electronics and batteries etc should be in the cabin because that's generally the cleanest, driest and coolest else most moderated environment.
For an inverter, the engine bay (ie, near the alternator) is good because of the shorter heavy gauge requirement. But it means higher ambient temperatures (generally each 10C/15F else 15C increase doubles electronic failure rate) and a contaminating environment. It might require a longer AC run thru firewalls etc, tho unlike domestic AC it should not be a hazard for a single sided fault (ie - inverters should have isolated outputs that are floating aka independent of input DC +ve & -ve), but an RCD (Residual Current Device) can be used on the inverter output.
The boot/trunk is usually the 2nd preference after the cabin depending on cable requirements, but they can be the hottest location on average in hot climates (solar heating; no ventilation).