You cannot stop him to solemnise marry with that girl. However, you are friend and he had affair with you for more two years, but he did not promise to marry you. In devoid of any promise you cannot claim that he has no right to plan marriage with another girl.
Boyfriend affairs with another girl
Having affair with another girl is not illegal act. Relationship establishes on the free consent of persons. Law does not forbid two adult persons to date each other or be in relationship. If their consent is free, then they can live in relationship as they wish.
When he cheated or exploited you in the shadow of such a relationship then you can initiate proper legal action against him. He did not give you promise of marriage. So, you cannot say that he is doing wrong to date with another girl. Law gives freedom to adult and sane person to establish friendship through their free consent.
You cannot stop your boyfriend to marry another girl
Your boyfriend has exclusive right to decide to whom he’ll marry. Even his parents cannot compel him to marry with a girl of their choice. In Shakti Vahini v. Union of India, (2018) 7 SCC 192, the Supreme Court has held that the right to select a life partner is a fundamental right. So, he has the exclusive right to take decision about his marriage.
He did not cheat or sexually harass you during the two and half years of relationship. So, you cannot say that you are aggrieved by his decision to marry with another girl. You both are sound mind and adult person. Two and half year is enough time to understand each other.
If he decides, after such a long period that he’ll marry to another girl then he has some reason thereof. In this situation you cannot pressurise him to retract his decision. Your boyfriend affairs with another girl and planning to marry because he does not want to marry you. You cannot interfere in his decision.