Could be the way you're turning your legs inwards (or outwards) due to lack of cycling or change in flexibility - possible solutions an up to date bike fit if you haven't had one recently, although they will probably do one of two things for that based on personal experience adjust your cleat angle to make the leg turn as it should and/or add a wedge under the insole to change the "drive" angle
If you dont want the expense of bike fit, you could perhaps try adding some flexibility exercises into your daily routine, perhaps those specific to the piriformis might be a good call and will open up the hips, changing the drive angle and in turn eliminating knee pain?
Anyway what do I know

but it might help ITB