Make a transistor act as a potentiometer
The feedback input pin on the device will normally be sitting at 1.25 volts when the output is at the correct level. R1 and R2 and the output level of 18.5 volts produce exactly 1.25 volts on this pin.

However, if you inject a DC current into the junction of R1 and R2 you are telling the chip that it is creating too much output voltage and therefore the chip will alter its duty cycle accordingly and produce a lower output voltage.

This is the way to control the device - use a DAC and current source. You can compromise this to a DAC, an op-amp gain stage and a biggish valued resistor. This can be further compromised using a DAC and a medium value resistor. To avoid changing the base value you need to ensure that your DAC can produce 1.25 volts. If you want the output level to fall inject current into the node.

If you want the output to rise above the "nominal" take current from the node but be careful because you don't need to take much before the output voltage possibly doubles.

So, don't try and pursue getting a transistor to act as a pot. About the only similarity is that it has three terminals. Injecting/extracting current is the clean way of doing it.