The literal lating translation would be " while the crime is blazing"... [flagrante, ablative of flagrāns, blazing + dēlictō, ablative of dēlictum, offense.]
The phrase has certainly come to be used quite commonly with a sexual connotation, but it simply means, as Peter Pedant says, "caught in the act" - any act of a dubious, suspicious or criminal nature.