Catalysis of the reaction: a 2,3-saturated acyl-CoA + O2 = a (2E)-enoyl-CoA + H2O2. [ https://www.rhea-db.org/rhea/38959 ]