All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger. We ask Allaah to exalt his mention as well as that of his family and all his companions.
It is forbidden in Islam to establish any forbidden relationship; however, this relation by itself does not invalidate the fast unless you ejaculated due to touching, kissing and the like, in which case the fasting is invalidated. Each day should be made up with an equal number of days. According to the preponderant opinion of the scholars you are not obliged to expiate by fasting two consecutive months unless you invalidated the fast by actually having sexual intercourse. For more benefit, please refer to Fatwa 82187, and on things that invalidate the fast, please refer to Fatwa 85377.
Finally, it should be mentioned that you did well by making up the fast of the days which you mentioned and by repenting from that illegal relationship, so you should continue to perform good deeds in the future.