Relieve pain, prevent injury, and increase performance. Get customized mobility coaching developed by Dr. Kelly Starrett.
As far as your squat goes have someone watch you or video yourself watch for any spinal reversal. Just keep yourself honest in this area.
Tight hamstrings can be a motor control issue. If you have someone around that can check your active straight leg raise (FMS) and toe touch. If you can easily touch your toes with a rounded back but score poorly on active straight leg raise its not in your hamstrings. Chances are that your hamstrings are getting tight as a protective mechanism. They may also get tight as a counter to excessive tension in the front of the hip. So keep the anterior chain supple as well.
Work on setting your hips back a little more and play around with your hip hinge movement. Dan John and Gray Cook have good stuff in this area.