Practicing front squats helps. Depending on your height, limb proportions, and femur to waist ratio, a deep squat with the back vertical will be hard to obtain without hurting yourself or struggling pretty much ever. And that's perfectly fine. As someone mentioned above, do your best to squat to parallel, and then work to a deep ass to grass squat. If you have longer legs than your torso, you will bend forward regardless, espeacially as the weights get heavier. That's just how it goes. Keep your chest up, eyes on a steady target, and neutral spine.