Only suffered this as a result of way too much road biking, as in, doing rides 4 times a week at max effort, six years or so ago. Eventually caught up to me after a very long solo ride where I wanted to keep a certain average speed. Result: inflamed piriformis on the right side (which is also my stronger side, ride right foot forward in trials). Went to a cycling specific physio for this, and what helped me most was doing a specific stretch on my desk every 20 minutes (!), this one. Set a recurring alarm on my phone for this, and kept at it for weeks. Combined with taking it easy riding wise (but not sitting still), it still took a few months to disappear 100%.
Besides the direct overload from the road biking, the underlying issue was just sitting on my ass too much (work behind a computer) and being very stiff in the hips. Aside from that one stretch that targets the piriformis directly, I found doing yoga moves and hip mobility excercises a few times per week really help with the stiffness there. For trials especially, the less stiff I am in my hips, the more relaxed I can ride, and the more bouncy I feel on the bike. Now I'm getting a bit older (40), I very much notice the difference, off the bike too, so I find that's really worth investing in.
Hope this is of any use!