There is also a tour option:
I don't have enough posts to add a link, but if you google 'Transportation from
Disneyland to Magic Mountain, the first result is a tour service:
Looks like $108.99 pp (regular park admission $61.99 or $36.99 when purchased online)
To be honest, it is a very difficult haul between Anaheim and Valencia if you don't have a rental car. Renting a vehicle for a day would be the most affordable and time saving option.
Using transportation, the 'easiest' way would be to:
Take OCTA to the Amtrak Station
Take the train to Union Station
Transfer to Metrolink service to Lancaster
Exit train in Newhall
Take two busses to the park, including a semi hefty walk to the gate.
or
Take the 460 bus to Downtown LA, and transfer to Metrolink.
Both transportation options will result in 3-4 hours EACH WAY and about 6 hours in the park.