What happens if your entire crew is in the enemy ship and your teleporter gets damaged in your ship, with no way to repair it? You immediately lose?
When the battle is over, there will be a popup saying that your crew used one of the other ship's shuttles to return to yours. This will get all your crew back to your ship.
This can happen at any point after the battle, such as if the teleporter is destroyed by fire after the battle is over or if the last crew member on your ship suffocates.