Right now your hip flexors and erector spinae are short. Stretching them will help with the problem, however it will not stop it from coming back. The muscular problems associated with this postural deficiency are weak abdominals, weak hamstrings and weak glutes. It's very likely your quadriceps are dominant and your knees extend over your ankle line when you squat. Really focus on strengthening your glutes and hamstrings.