Pretty sure if you change ownership of a ship to the player's control then order it to load a unit, then change the ownership of the ship to say, Neutral Passive, you won't have access to the Hero anymore but upon unloading it will retain the original ownership of the Hero.
So For Example:
Change Ship to Red's Ownership ---> Load Red's Hero Into the Ship ---> Change Ownership to Blue (Red no longer controls the ship or hero) ---> Order Ship to Unload ---> Hero will exit as Red's unit.
Not sure if you can do it with multiple Heroes though.
EDIT*
Now that you mention it I'm 100% sure that a shared control ship allows you to load heroes for all allied players with shared control into it.