How did the Bodhisatta know there was nibbana. Before he had attained it?

https://suttacentral.net/mn26/en/bodhi?lang=en&reference=none&highlight=false
Ariyapariyesanā Sutta

Bhikkhus, before my enlightenment, while I was still only an unenlightened Bodhisatta, I too, being myself subject to birth, sought what was also subject to birth; being myself subject to ageing, sickness, death, sorrow, and defilement, I sought what was also subject to ageing, sickness, death, sorrow, and defilement. Then I considered thus: ‘Why, being myself subject to birth, do I seek what is also subject to birth? Why, being myself subject to ageing, sickness, death, sorrow, and defilement, do I seek what is also subject to ageing, sickness, death, sorrow, and defilement? Suppose that, being myself subject to birth, having understood the danger in what is subject to birth, I seek the unborn supreme security from bondage, Nibbāna. Suppose that, being myself subject to ageing, sickness, death, sorrow, and defilement, having understood the danger in what is subject to ageing, sickness, death, sorrow, and defilement, I seek the unageing, unailing, deathless, sorrowless, and undefiled supreme security from bondage, Nibbāna.’

It was a concept already floating around at the time.