For as seemingly simple as a pot is, there are literally millions of variations of the the things so the numbers stamped on them are usually not a part number,
per se. More like a VIN for a car. It's an encryption of a subset of a number of important non-obvious characteristics, and there's no real standard methodology for how it's done. Because like a VIN it's not a real part number, there's no way to look it up. You need the manufacturer's "cipher", so to speak.
For an example of how many different pieces of data can be involved, look at the top of
this catalog page, which is just a chart describing a range of similar parts. It is by no means all-inclusive, it just sorta presents the scope of the problem.
We can narrow it down a bit just by manufacturer, in this case CTS, to get
this.
You can narrow it down through successive approximation by highlighting known characteristics and clicking the "Apply filter". While it can be tempting to highlight as many things as you know at once to filter the set down fast, you have to be careful you don't overshoot the detail and get a "no known part" (or words to that effect) response.
When you find something close, clicking on the "datasheet" link will take you
here, where there's far more information than you will likely ever want to know. There's usually a chart to show you how the numbers are encrypted, like this...
Think you've finally found the holy grail? Haaahahaha!!! Unless it's a common retail part, the frustrating thing is you may have a surplus part from a limited or special production run. This happens far more often than you might think, as some OEM who buys lotsa parts may ask for a designation for a characteristic that's unique to them, and that data is not always available. For example, if somebody like Sony wants a code that describes a part that goes into an assembly that they only sell to Amazon, CTS is likely to give it to them lest they risk losing the sale of XX million pots/year. But, it's not likely that designation will show up in any charts. It's more like political data than an objective characteristic, so it doesn't go into the part number. Excess production gets sold to jobbers, who dump the stuff on the market with a general description that gets potential users close enough to use the parts without concern for some of the more esoteric details.
I could go on and on, but long story short, identifying pots is a bitch. The best way is most often the way Mayfly said - take a meter to it and expose its secrets that way. As long as it's a 2 watt 3/8" panel mount 1/4" shaft with the resistance and taper you want, it'll likely work in a guitar.