Encoder, how do I???

Don't know how many counts per revolution you want...

But for the simplest encoder - you would want a segment (paper of thin sheet metal) attached to the spindle that would block the optos for 180 degrees of rotation. place the 2 optos 90 degrees apart. This wold give you 4 transistions per revolution - 00 - both off. 01 - A on B off. 11 - Both On. 10 - A off B on. and repeat.

The important thing is that however many counts you want that you can get the 00, 01, 11, 10 pattern out of your encoder.

What kind of lathe are you using this on? Using it for speed control or threading?