The most reliable way it usually to watch out for the fish 'squaring off'; the fish's belly will develop distinct corners (it will look like she's eaten a box!).
Once that happens they usually give birth within 24 hours, although they can hold on to the fry, if they don't feel safe, so make sure the tank has plenty of hiding places; lots of plants are good.
Don't forget the tank will also need to have a cycled filter.
Swordtails can have around 40 fry, but young females will have fewer and mature females can have 60 or more!