Depending on the size it's easy. If they're a couple of inches, the male will have rows of spangles. On the female, the spangles won't be in rows, they'll be clustered with much less color. On cichlids that have been kept together dorsals get bitten off or torn up. Fin shape isn't the best method so don't rely on it exclusively.
On fry, the males grow faster. If you want to ensure a pair, buy 6. Get 3 bigger ones and 3 smaller ones.