There are several things they sell that enables you to do so. There are the soft netted breeders that you can hang on the side of the aquarium. You can put the mother in, wait for her to give birth, then remove her. The only downside about those is that algae can grow quite readily on the netting. So you'll have to take that algae off regularly so it doesn't literally choke the breeder up and it doesn't get any circulation. That can prove fatal to the fry.
There are also the hard plastic ones, but I think those are built differently. Like you put the mother in there, then she gives birth and the babies slip through bottom slots and into the aquarium. But in order for you to be able to do THAT, you'd have to remove the glassfish, and any other potential predators.
Then there is always your divider approach..