The old idea with a generator was a 16 amp socket on the generator and a 16 amp socket from the grid, and you manually decide which to plug into.
and
The only other safe method is to have the whole garage on a suitably rated plug, and then have 2 socket outlets, one from the mains supply and the other for the inverter.
Changing over involves unplugging from one supply and plugging into the other one.
means that any other supply can also be used, like hire a generator.
But I want automation, and today most inverters have some method to automate. Most portable inverters

will work as an UPS, so any power taken from those built in sockets, will be supplied from the mains if the unit is plugged in, and revert to battery when unplugged. Larger units have more options my inverter
can be configured for mains or generator, with mains, I can set it to charge batteries over night and in the day first solar, then batteries, and if they are not enough then it will allow use of the mains. It also has a dedicated output which will not fail if the mains fail, but most of the house will fail with a mains failure.
With a generator it can auto start and stop the generator, and ensure when the generator is running, it has a reasonable load.
But it is either/or it will not work with generator and mains.
And this is the same with plug in inverter/battery packs, what they can do, varies pack to pack. Including the use of current transformers (CT) to decide what it should do.
There are units which do more than mine. But power cuts are not frequant enough to be worth the extra expence.
I also have a very old battery pack/inverter

only 300 watt, and simulated sine wave. OK also will jump start a car, the compressor long since failed.
But basic the more it does, the more it costs, and one has to decide how far to go. I fancy the new breed using drill batteries etc. But I don't really need one. I built a lead
so with a power failure I can use any 12 volt battery to power things which will go in a cig socket, like USB charger, and that is enough to keep me going with a power cut.