usely by venting, thats the male's breeding tube is smaller and more pointed, while the female's is rounded and a bit larger, since it's designed to pass eggs. You can also see that the male's body tapers downwards from the breeding tube to the anal fin, while the female's body tapers upwards slightly from the ovipositor to the anal fin.
Another common (though not 100% reliable) method of determining sex is by the dorsal fin. There is a gradual slope to the rays of the fins, with only a very slight elongation of the third ray. Many males, on the other hand, have a much more elongated third/fourth dorsal ray.