It's possible they used a lathe to turn the part down, then used a tap and die to thread it. Found this about tap and dies:
"Metalworking taps and dies were often made by their users during the 18th and 19th centuries (especially if the user was skilled in toolmaking), using such tools as lathes and files for the shaping, and the smithy for hardening and tempering. Thus builders of, for example locomotives, firearms, or textile machinery were likely to make their own taps and dies. During the 19th century the machining industries evolved greatly and the practice of buying taps and dies from suppliers specializing in them gradually supplanted most such in-house work. Joseph Clement was one such early vendor of taps and dies, starting in 1828. With the introduction of more advanced milling practice in the 1860s and 1870s, tasks such as cutting a tap's flutes with a hand file became a thing of the past."