I'll venture a guess that your riding technique might be wrong or that you're seriously out of shape. Without seeing you riding its hard to say why your legs hurt so much, because they really shouldn't. I'm guessing this is your second season? It could very well be that now when your confidence is increasing you start pushing yourself harder, maybe going faster or becoming more aggressive and that wrong positioning that you were able to get away with last season puts too much stress on your legs.
As exercise goes don't do squats, instead do Bulgarian lunges (a lunge with a back leg on the chair). Don't bend your knee too much you don't need it, just enough to feel your quad and calf muscles working. Stay in the position for 15-20 sec. then slowly get up. The key is to do it slowly. Don't kill yourself with overexercise. Do as much as you can and increase time/repetitions bit by bit over time. That is one exercise that puts minimal stress on knee joint. Another good exercise would be elliptical. Also do a good stretching before, mid and after riding. That'll save you quite a few Advils.