The 18 gauge leads of the power supply are okay.
They are connected (wire nutted) to the #12 etc. wire ends. Code (the tap rule) permits something like 18 inches worth of wire less than #14 to get from the usual #12 etc. conductor to the lamp socket, power supply transformer, etc. within a box or via conduit.
The power supply does not draw enough amperes to overload the #18 leads. That is all that counts.
The thinness of the #18 leads will start to cause a problem on the low voltage side first due to voltage drop. You might need heavier wire depending on how long the low voltage run is and how many amps at the low voltage you will draw. The existing 6 inch or so #18 low voltage wires can stay as-is and the fact they are furthest upstream will not nullify the benefits of fatter wires, if any, continuing on.
They are connected (wire nutted) to the #12 etc. wire ends. Code (the tap rule) permits something like 18 inches worth of wire less than #14 to get from the usual #12 etc. conductor to the lamp socket, power supply transformer, etc. within a box or via conduit.
The power supply does not draw enough amperes to overload the #18 leads. That is all that counts.
The thinness of the #18 leads will start to cause a problem on the low voltage side first due to voltage drop. You might need heavier wire depending on how long the low voltage run is and how many amps at the low voltage you will draw. The existing 6 inch or so #18 low voltage wires can stay as-is and the fact they are furthest upstream will not nullify the benefits of fatter wires, if any, continuing on.