You can do it and I've spent a career working on designing and selling auto start systems and power transfer equipment for industrial use.
You would have to install a transfer switch. Then you run into the issue of how do you disconnect the starter when the generator starts, so now you need either a smart system controlling the generator or you need to install a generator control panel to use the industry-standard two wire start.
Like I said, I've done this entire adult life and I don't have it on my boat.
there are times I suppose it would come in handy. but for most of us you're either sitting at a dock maybe not on the boat or you're at anchor, and you are on the boat. I just don't see the need