What's the best way to train legs in the gym with weights to have it transfer over to my biking.
People have to know what you are asking, before they can answer your questions.
Even if some one gives a "best" answer about an exercise, it's only the "best" answer for single specific situation, which often does not apply to many people.
The best exercise for you, using a gym, or a bicycle, is the exercise that isolates and stresses that muscles that limit your performance. As Clint Eastwood used to say: "A man's got to know his limitations."
Without an evaluation of your needs and goals, I'd have to say: "Do you feel lucky? Well do you punk?" "'Cause you're gettin' nothing but a barrel full Bool Chit - so far."