In the trial of an offense under Section 21.11 or 22.011, Penal Code, the judge shall make an affirmative finding of fact and enter the affirmative finding in the judgment in the case if the judge determines that:
(1) at the time of the offense, the defendant was not more than four years older than the victim or intended victim and the victim or intended victim was at least 15 years of age; and
(2) the conviction is based solely on the ages of the defendant and the victim or intended victim at the time of the offense.