I had really bad back pain within the first 5yrs of cycling so tried loads of things.
Usual as already mentioned, flexible hammys and butt, reckon if you can’t touch your toes that’d be a good start. Saddle height, if it’s too high it can put excess stress on your back (too low and excess stress on you knees mind). Also loadsssss of core work.
Might be worth seeing a specialist.
I was the kind a guy who refused to do so for a long time, convinced core exercises and stretching was all I need, they did help, a lot but something still wasn’t right, so went to go see a chiropractor. Turns out I has 3 seized vertebra that I might have had since birth! Few sessions later and the difference was night and day. Did a few 24hrsolos with no back pain what-so-ever 🙂