At any point after you've beaten the game and gotten your National Dex, you can return to Castelia City and check out the pier directly south of the Pokemon Center. That big gold cruise ship there is finally letting people board! It's only available in the afternoon, and the timeframe varies depending on what season it is. But all you'll need to do is talk to the lady at the entrance of the boat and she'll let you board for $1000.
You can't use your C-Gear while you're on the boat, but there are
Trainers that you can battle aboard if you talk to them. Not all of
them will battle you, though, and you don't have very much time aboard
the boat to battle these Trainers, but if you can beat the required
number of Trainers in that amount of time, you may be rewarded with
rare items such as Lava Cookies, RageCandyBars, or even Rare Candies,
although the number of Trainers you have to battle — as well as the
potential reward — varies based on what day it is. (RageCandyBars are
available on Saturdays and Rare Candies are available on Sundays.)
You can board the boat once a day, and, again, only in the afternoon
or closer to sunset (depending on the season).