More specifically than Adam, I would attempt to find, in this order:
A bike fitter who knows biomechanical issues well. Simply having lasers in their studio doesn't cut it. You will need to find someone who knows the human body well.
A physical therapist who has some specialization in sports.
I don't know how helpful it is to see a medical doctor. A primary care MD may just order X-rays to check your cartilage, prescribe you pain medication if needed, and maybe refer you to a physical therapist. A more specialist MD might be warranted if you are thinking of surgical treatments for your knee, but you want to address how you interact with the bike and any weaknesses in your muscles before you let things get to that point.
A good bike fitter should be able to help you work out your bike fit. One of the things that a good one will look for is how your knees track while pedaling. You don't want your knees to kick outward or inward during the pedal stroke. This video isn't a perfect illustration of that phenomenon, but it's the best I can find right now. Knees not tracking can indicate an issue with your bike fit - for example, I had my saddle up too high, and one of my knees was flaring out slightly, and I developed an overuse injury this way. In addition, a good fitter should assess for any physical asymmetries - for example structural or functional leg length differences, with the latter meaning that it's not your bones that are actually longer, but rather something about your musculature, maybe as a function of your posture, affects how you sit and stand, thus affecting your leg length.
A good bike fitter is also likely to know stretches and exercises that address muscular imbalances that can contribute to knee pain. Physical therapists should also know these exercises and be able to assess them. I suspect they won't have the knowledge to sort out your bike fit. You may benefit from seeing both types of professionals at the same time.
I am less sure how to reliably find a good bike fitter. I don't know that all bike fitters are good. For sure, there is a learning curve. The human body is complex, and the ways it can interface with the bike are complex. I'm going to bend the site's norm of not recommending specific products to show what I would try to look for. Steve Hogg appears to be one professional who's thought deeply about these types of issues, and he has trained bike fitters in a number of countries. Note that Hogg personally prefers a cleat position that is much aft of the norm and that may not work for all riders, but I don't think that's a symptom of maladaptive thinking. The bike fitters who sorted out my issues were not affiliated with Hogg et al, but they had extensive experience with professional athletes before becoming independent bike fitters. They're in Minneapolis, Minnesota in the US.
In the list above, I made a dig at fancy fit systems. I was thinking about Specialized's Retül system. My point is that merely possessing advanced equipment is unlikely to be enough. Possessing a Retül system is absolutely not a disqualifier, it's just that you need someone with hands on experience with athletes. Searching for a good one can be tricky. Thinking about the issue, I actually do not think I can think of disqualifying signs that are reliable enough that I'd state them here. If you have riding friends, see if you can get recommendations by word of mouth.