How do I hook up a new "pull-type" light switch in my basement utility room?
The extra brass colored box is a transformer for a low voltage system, probably a doorbell. One wire on the outside probably goes to the push button and the other to the chime. It could be some other low voltage device, doesn't really matter, it's definitely a transformer. The green wire appears to be a site installed modification to ensure proper grounding. The smaller black wires are for 120v power. One to house black, the other to house white. Which goes to which does not matter.

To install a lamp base with a pull switch, you need short lengths of white and black wires with solid copper conductors the same gauge as the house wiring. Connect the black one to the brass screw of the base and the other end to the other house black wires and one of the transformer blacks. Connect the white one to the silver screw and the other end to the white house wires with the other transformer black.

If the base has a green and/or hex shaped grounding screw, it is connected to the other grounding wires with either green insulated or bare copper wire. Since these sort of bases are usually non-metallic, there's usually no grounding screw. But if there is one, it needs to be connected.