Go to the teleporter where you can VS Knuckles, then talk to Tails and select 'yes'. You'll then VS Eggman with Emerl and after that you'll VS Emerl with Sonic.
If you do get stuck after getting on the ship, follow these steps to ensure your victory for both:
If you have Sonic bouncing attack (sorry, don't know what kind it is) then use it all the time and if you have Shadow's meteor attack, then throw Eggman hurtling to a wall and use the meteor attack (that's IF you know how to use it). Also, when you take a life from him, you must run away or that'll hurt you.
There is only one piece of advice for this and that's to stop him form attacking you for even 1 second because all of his moves are full speed and full strength and as soon as he's started hurting you, you'll be dead.
Here's 2 bits of advice so you will have something to do afterwards (or stop you from doing this over and over again for nothing):
1. The Virtual Thingymabob (don't know what it's called) can give you Emerl's super attacks. Unfortuantly, they take up alot of space and if you die once you start all over again. It also takes longer every time you unlock these super powerful moves.
2. The Sonic Team building is used for putting in cheats which of course are shown on the 'Cheats' section for this game (and if they aren't don't bother asking me, I don't remember).
I knew you were going to say that. In fact, I lied to see if you were really guliable (which you probably are). Anyway, you actually press on the ship, which is in the Chao Ruins. You should teleport over (if that doesn't work ask Tails, and then press on it). If what I said last time actually works, then you just wasted time reading the rest of this.
BTW, I'm not lying about the tips and Virtual Trainer (that maybe is it's real name), so check them out afterwards. Also, don't bother reading the colurful text that Emerl says when he's super powerful. Even though it's just a bunch of garble as I remember it).