It's not illegal for the passenger. It's illegal for the non-captain. Just like any other business, you cannot sell your services if you aren't licenced. If you want to pay for some of the gas for your buddy to take you that's one thing but for someone who is not a licencend captain to pick up random people for money is just asking for trouble.
More information about formatting options