At Savatthi. “Bhikkhus, before my enlightenment, while I was still a bodhisatta, not yet fully enlightened, it occurred to me: ‘What is the gratification, what is the danger, what is the escape in the case of form? What is the gratification, what is the danger, what is the escape in the case of feeling … perception … volitional formations … consciousness?’ sn.iii.28
“Then, bhikkhus, it occurred to me: ‘The pleasure and joy that arise in dependence on form: this is the gratification in form. That form is impermanent, suffering, and subject to change: this is the danger in form. The removal and abandonment of desire and lust for form: this is the escape from form.
“‘The pleasure and joy that arise in dependence on feeling … in dependence on perception … in dependence on volitional formations … in dependence on consciousness: this is the gratification in consciousness. That consciousness is impermanent, suffering, and subject to change: this is the danger in consciousness. The removal and abandonment of desire and lust for consciousness: this is the escape from consciousness.’
“So long, bhikkhus, as I did not directly know as they really are the gratification, the danger, and the escape in the case of these five aggregates subject to clinging, I did not claim to have awakened to the unsurpassed perfect enlightenment in this world with its devas, Mara, and Brahma, in this generation with its ascetics and brahmins, its devas and humans. But when I directly knew all this as it really is, then I claimed to have awakened to the unsurpassed perfect enlightenment in this world with … its devas and humans.
“The knowledge and vision arose in me: ‘Unshakable is my liberation of mind; this is my last birth; now there is no more renewed existence.’” sn.iii.29