Transistor Level Shifting in Buck-Boost Converter
The transistor's base is tied to ground, which means that the current through R1 depends only on the output voltage (along with the base-emitter drop of the transistor). The transistor sets the current through the 1.24K resistor (R2?), but keep in mind that there's also a significant voltage drop (roughly Vin - 1.24V) across the transistor itself, which varies with Vin.

If you just set up a resistive divider without the transistor, then the current through it would depend on both Vin and Vout, which would eliminate the ability of the circuit to ignore changes on Vin (line regulation). Sometimes you do this on purpose, if your intent is to create a "tracking" supply, but that isn't the intent of this circuit.