The obvious answer is look at the manual or hope that somebody like Brownells can tell you. But if you have the original its easy isn't it ? First mike it. Most screws are slightly under nominal diameter, so if it mikes 0.245 you know its quarter inch. Then lay it on a sheet of white paper alongside a ruler, and count how many turns in one inch. I have machined quite a few gun screws by that method, and have never needed a thread pitch gauge. But that is not deny their usefulness, they are cheap and worth having.
If you don't have the original screw, its a bit more tricky. But you rely on the balance of probability. Mike the ID of the female, which is the minor diameter. The odds are that that will tell you what the thread is likely to be. Then try a screw of that diameter and pitch to see if it fits. If it doesn't, you might have a fine pitch instead of the standard pitch. All the metric threads have both standard and fine pitches.
I fell foul of that some years back, when a thread pitch gauge would have saved me some work. A customer had lost the little striker locking screw from the bolt of his SMLE. They are not as available as they used to be, so, not being able to locate one, I set about making one.
The screw from another SMLE measured 3.60mm diameter, and my crude method of measuring the pich indicated it to be 40 TPI. When I had made the screw it would enter the female only two turns. Close examination of the factory thread revealed it to be # 4 BA, which is something like 38 TPI. BA threads are actually metric, so # 4 is not exactly 38 but very close. So I reset the lathe gears and made another screw, which thankfully fitted.
Of course, the diameter of 3.60mm should have warned me to check further. Mistakes always cost something.