Stretches and practice are all great suggestions. It comes down to muscle memory.
Another thing to think about is perhaps doing "reverse flys" with weights at home or in a gym to strengthen/tighten your back muscles so they start to naturally change your posture and keep you that way.
Sometimes trainers put a crop behind the rider's back and under the upper arm to help keep shoulders up. Or you can wear this vest that basically stops your shoulders from moving forward. I forgot what it's called but if you want I'll google it:)