It is most likely either something in your posture at the keyboard, or the actual technique you use to play. Try just sitting at the keyboard with your hands on the keyboard for 15 minutes, and see if just that produces pain. Until you do this, you will ultimately only reinjure yourself every time you go back to playing.
Most teachers are steadfast in their dedication to the technique they use and teach.
But I had to change teachers and start fresh in order to affect these changes.