Well, if you are seated and climbing, or pedalling at a low cadence in a big gear, it would be an indication that you are not using your glutes or proper pedalling technique. Since you don't know how to activate your glutes you move your shoulders and body instead, pulling your back in the process. Or, you use your hamstrings longer then needed, which pulls on the lower back. Here is a diagram illustrating which muscles need to be used when:
So what can you do to prevent back pain?
Step 1: Get a proper bike fit done, and keep going back to the fitter until all fine tuning is done.
Step 2: Work on correct muscle activation for the full pedal stroke.
Step 3: Build core strength and stability. Here are some suggestions of exercises to do.
Ride on, ride straight, ride strong.