Leadscrew is installed on the shaft mounts much the same way as pulley shafts are, though one difference is the amount of allowable slack.
The ends are secured with 1/4" nut, spring lock washer, and another 1/4" nut. Secure the motor end first to position the leadscrew so it will fit the motor coupling. On the other end, the nut should be tightened to the point where there is no axial slack on the leadscrew plus a little more, maybe quarter or half a turn. Tightening spring washer/second nut will relax the first one a bit.
Depending on how tight it is, if the shaft mounts are not aligned well, the torque to rotate the leadscrew may be uneven. If this is the case, either allow a tiny bit of slack, or align the shaft mounts better.
You can eyeball the shaft mount alignment, but for reliable operation, it needs to be aligned well. Read more on leadscrew drive alignment.
You may or may not want to install the motor prior to installing the leadscrew. If you're going to align the shaft mounts, it's better to install the motor at the end.