How might Buddha have seen how far the gratification, danger and escape extend? In "The Connected Discourses" Buddha says 


  “Bhikkhus, I set out seeking the gratification in form. Whatever 
  gratification there is in form—that I discovered. I have clearly seen
  with  wisdom just how far the gratification in form extends.
  
  “Bhikkhus, I set out seeking the danger in form. Whatever danger there is  in form—that I discovered. I have clearly seen with wisdom
  just how far the  danger in form extends.
  
  “Bhikkhus, I set out seeking the escape from form. Whatever escape there is  from form—that I discovered. I have clearly seen with
  wisdom just how far the  escape from form extends.


How might he have seen how far the gratification, danger and escape extend? Did he elaborate on this any where else?
Because He was the one who experienced it all. As a prince, He had all the necessary means to experience the maximum level of pleasure/gratification. Later on, as the most extreme self-mortified ascetic, He was able to experience the most terrible kinds of suffering. Abandoning both extremes, He meditated and penetrated the Four Noble Truths. Then after this major breakthrough, He was able to claim that He directly knew as they really are the gratification, the danger, the escape, etc. In short, due to various factors like his time as a prince, an extreme ascetic, and the final breakthrough to the Four Noble Truths, the Buddha was able to see the true nature of all phenomena. In SN 14.31, Ven. Bodhi provided the Commentary's note:


  Spk: In this sutta the Four Noble Truths are discussed. The "gratification" (assada) in the four elements is the truth of the origin; the "danger" (adinava) is the truth of suffering; the "escape" (nissarana) is the truth of cessation; the "path" that understands the escape is the truth of the path.