This is a low-load application, only used to turn on the gate of a triac. The exact specs of the transistor largely don't matter other than the voltage rating.
Only about 20-30mA flows through the transistor when it's on. The motor looks like it may run on 50-100V, so it'd be best to use a transistor rated for 200Vceo at least.
The jellybean go-to choice for that would be MPSA92.
This old thread on DIYAudio [...] suggests a substitution ("2n5415, 2n5416") but I'm not sure on what basis.
The substitution is based on the identical case and suitable Vceo (250-350V for 2N5415/5416 respectively).
If you're going for authentic look/restoration, 2N5415/6 are good substitutions since they should be direct fit. If I was repairing the printer for my own amusement only, I'd just stick an MPSA92 there since I got a bunch of them already.
One suggestion though: do not solder the replacement transistor so close to the PCB. It puts quite a bit of stress on the pins and the hermetic seal around them as the temperatures change. There should be at least 5mm of lead between the component side of the PCB and the transistor.