Recognizing Cartesian decompositions for transitive permutation groups