If you have pain, your body is warning you.
It is absolutely wrong to ‘play on through the pain’.
Relaxing can be done in almost any situation and even unnoticed by others. Either on rehearsal or on stage, make good use of small breaks to perform some exercises. Make them a habit. At home, take a 10 minutes break after each 30 minutes of playing. Use them to do some exercises, to get yourself a drink, to listen to music you might want to try and play etc.