The anatomy of the upper body:
The upper body must perform two basic operations i.e Push and Pull. The push requires the strength of the front shoulders, chest, and triceps (The part of arms behind the Biceps) while the pull motion requires the strength of the rear shoulders (also referred to as the delts), back, and biceps. The push is further basically divided into three sub-motions i.e vertical pushing (more emphasis on shoulders and upper chest), horizontal pushing (more emphasis on the chest), and downward pushing (more emphasis on the lower chest). The pulling motion, on the other hand, is divided into two sub-motions i.e vertical pulling (emphasis on mid-back) and horizontal pulling (emphasis on upper back and rear shoulders). The only way to strengthen any of these sub motions is by actually training them during a workout.
Unbalanced Push and Pull:
The current problem with gym-heads is that they are more obsessed with growing their chest and shoulders so they focus on them and often neglect their back. Having a strong chest is very important but having a well-balanced body is even more important.
“Your body is as strong as the weakest part of your body.”
The anterior (front) part of your upper body prevents your body(shoulders) from going too far backward (i.e pull your shoulders in the forward direction) whereas the posterior (back) part of your body prevents your body from going too much forward (i.e pull your shoulders backward). When these two forces exerted by the anterior and the posterior part of the body is balanced, you have a good posture. When you train your chest while neglecting your back, the front side (the chest side) of the body becomes stronger whereas the backside of the body remains weak, so this causes muscular imbalances (and also an imbalance in the forces exerted by the anterior and the posterior part of your body, since the anterior part of the body is now much stronger than the posterior part and hence exerts more force forward). Hence you start hunching forward due to higher pull exerted by the anterior side of your upper body. Vice versa would happen if you train the posterior part (back and rear delts) of the body more than the anterior part hence causing you to hunch too far backward. Hence push and pull motions should be trained equally for good posture and optimum performance of the body.
If you have already performed these mistakes in the past, stretching your chests and shoulders and training the back religiously would help you get out of it.