Upvote:3
You should travel by train. It's easy and comfortable.
The train from Zurich to Lucerne takes 45 - 50 minutes. There are two departures per hour and it costs 25 CHF. The journey from Lucerne to Basel takes 1h00 - 1h15 and costs 33 CHF. There are also two departures per hour.
There is no need to book in advance. Go to the station, buy your tickets and catch the next train. For prices and schedules you can check the website of the Swiss Federal Railways.