I would start in San Diego, and make your way north. For the major legs, I'd do this:
SD to Anaheim - Pacific surfliner
Anaheim to LA - Pacific surfliner
LA to EMY (SF) - Coast starlight (20 min bus ride from EMY to SF)
From SF you can take the san joaquins to yosemite (Bus takes you from...