Better ask authot of that circuit to explain how his firmware works and circuit.
In general voltage stabilization, monitor mains voltage over smaller transformer or direct with voltage divider using ADC on uC, and according to measured voltage uC switch corresponding tap on autotransformer.
You can find more mains voltage stabilization circuits, just search EDABoard existing threads.