When I started designing and producing mains stabilizers for the local consumers, around 4 decades ago, I used LM324 with trimmers to activate the relays properly (much like the one discussed here).
In my latest designs, I use the old MCU ATmega8A. It ADC pins read both the mains voltage and the output voltage as well. Trimmers are no more needed. I followed two topologies: old conventional and digital.
The MCU conventional design takes 1 relay for each boost tap and 1 relay for each buck one, besides 1 relay for protection (connected at the input, not the output as in the old designs). For example, if the transformer has 5 boost taps and 1 buck tap, the transformer has 7 taps (1 for in-out) connected to 6 relays (and the protecting one). Its advantage is that the transformer is cost effective.
The MCU digital design takes 4 relays (+1 for protection) to achieve 11 boost steps, 1 in-out, and 4 buck steps, total 16 steps (typical input from 120 to 285 Vac, to output 220 +/- 10V). Similarly, with 5 relays, we get 23 boost steps, 1 in-out, 8 buck steps, total 32 steps. But it is better for the latter one to use triacs instead of relays (that is 10 power triacs instead of 5 relays). Its disadvantage is that the transformer costs more than of the conventional design.
As most engineers are doing, I took advantage of the SMPS availability (say 24V, 1A) whose input can vary from 100 to 240V, to supply my boards. But I had to also design a small circuit to increase this range. By connecting it between the mains voltage and the SMPS input, the range becomes from 70 to 400 Vac.
Thanks to LTspice, I was able to test every design before drawing its final PCBs. I substitute the MCU by logic elements.