It's worth it to see a good physio who really understand this stuff. They may be able to identify if there is anything specific that is tight/weak. Each person is unique - especially if you are engaged in weight lifting which may have given you a larger muscle imbalance than the average hiker.
These seem to be generally recommended:
Some people have luck with these knee support things that have a hole in the front that holds the patella in place.
If you have the time and interest, this book has a lot of information about mobility in general. Honestly, everyone should be given more of an overview of this stuff in high school.
I assume you are using poles? If not, do that.
I find that taking a few breaks on the way down can be very helpful. It's almost like the difference between doing one set of 15 vs three sets of 5 - you are going to be able to lift a lot more doing three sets of 5. Next time the pain starts up, try sitting down for a legitimate five to ten minute break and keep doing that as you need.
Like most of these types of issues, I find that if I push too hard, then it takes some time to recover and even more modest hikes can be problematic for a while. I don't do that anymore. Mixing up sports (take up kayaking or biking or rock climbing) can be great if your issue is related to doing a lot of big elevation days in relatively short succession.