How can I train myself to sleep on my back for good posture?

Tough! Best bet is to have appropriate mattress (get fitted at a sleep center), and avoid pillows. Rather, use a "neck roll" or rolled hand towel to support your neck while sleeping. I like to "cradle" my head with two pillows on either side, but sleeping on my back increases my apnea, so I am obilgated to stay off it while sleeping--so be extra cautious if you have high blood pressure or snore heavily!
Sleep . Extra pillow under lower back while laying on your back, and as bonus, maybe pleasant theme on ceiling above your head.