The rules list the cases when the hazard lights must be on, and both options from the ticket are on that list. If a driver is blinded by headlights, they turn on the hazard lights: this warns the drivers behind that they may suddenly slow down or stop. When towing, the hazard lights are turned on on the vehicle being towed, so the drivers behind can see the slow-moving pair of vehicles. So the correct answer is “In both cases”