I personally have the advantage of having animated and built my rig with IK to start with, so I already have Knee Pit and Elbow Pit bones on the skeleton. I just use the location of these bones (technically, I set the joint position to 0,0,0 in Bone Space of the pit bone in question) to tell the IK solver where the joint should be. This is 99% perfect (there are situations where it’d look better to have the feet rotate slightly to one side and the knee to go with it, rather than rolling or yawing in the extreme, but oh well) since it means that as the anim drives the player’s feet it also drives the position of the knees accordingly.
Lacking this, I recommend manually setting the pit location using the forward vector of the foot bone (the knee pit should be some Z value above a space several units in front of the toes; typically the human leg does not rotate at the foot, so your knees usually face your toes).