The first way to prevent back pain while riding an e-bike is to ensure you fit properly. You need to avoid forward bending or slamming the stem.
The correct fit is directly related to correct posture and positioning. Besides the e-bike, it is also important to follow a stretching and strengthening regime.
Another common cause of back pain while riding an e-bike is bad posture. You need to maintain a proper posture to avoid over-stretching your muscles.
To avoid cramps and maintain a consistent pedaling motion, set your seat height at the level where you can extend your leg nearly fully when it is still on the pedal.