Take your shoes off and walk backwards, very slowly, consciously placing each foot so that your toes point straight ahead and your heels point straight backwards.
Do your knees hurt?
Do the same thing going forwards, placing your weight on the outside of your heels and transferring the weight to the front of your foot following the outside of your foot; and then, roll your foot to the inside so that the weight goes out of your foot between your big toe and your index toe.
When you get on your bike, visualize your foot squishing a bug as the pedal goes down and forward; and, visualize your heel going out.
Your knees will follow, in your mind, the following path: )(
Or so it will seem.
If you look down at your knees, they will actually go straight up and down, but if you don't look it will feel as if they will hit the top tube in the middle of their downward stroke.
We have a muscle in our buttocks, right under our hip pocket, and most people don't use it, and their feet point out when they walk.
Almost all knee pain (amongst Americans) comes from the lack of use of this sleepy muscle.
Again, walk backwards, slowly, with your hands on your hip pockets.
In order to keep your feet straight it will feel as if you actually have to turn your heels outward.
You will feel the muscle that needs awakening under your hands.
Look down at your feet while you do this, otherwise they will feel straight but they will point toes out.
When we pedal correctly, we will "see" the big foot bone that goes from our ankle to our big toe.
We will feel like we have a horse's or deer's foot, in that the big toe does more of the work than we ever thought.
Turn the toes in, heels out, push a little sideways with the foot, and try to hit the top tube with your knees.
When you remember to do this, the pain will go away within 30 seconds.
Or maybe not.