Hello there,
The simplest way is to use a half wave rectifier (one diode for rectification and one for shunting) and largish cap and divider resistors. Using a 1 megohm resistor in series with a 10k ohm for example gives you 3.5 volts for the uC ADC input at 250vac when you use a large enough cap. You can measure a few known voltages and calibrate in software if you like, or adjust resistor values to get more exact results.
As others have pointed out, the circuit will no longer be isolated from the line when you do it this way however so precautions have to be taken to make sure the user can not touch anything at all in the circuit that is electrically part of the circuit. This isnt always a problem, and sometimes the circuit is run from an offline power supply anyway so this is an option for some products.
If you need isolation then yes a transformer isnt a bad idea, and you can sometimes use the same transformer that powers your circuit to measure the line voltage with.
If you dont isolate then the pots you use (if any) should have plastic shafts. Other controls must be plastic too not metal.