Not sure what Miralax is but it can't be good to be taking it for long whatever age you happen to be...
I am not an expert but I think nature has better things to offer - a balanced diet with sufficient oils and fats to begin with and lots of clear fluids. Reduce refined sugar intake and processed foods to the absolute minimum and avoid caffeine and such like...
Adding some pre-biotic foods would also be good.
A good diet will, after an adjustment period, help the digestive tract process and move the food through the gut quickly to the bowel where it is stored temporarlily until the body recognises this and provides muscle spasms that puts pressure on the anus until evacuation can take place...
If the gut is working correctly and a stool is formed and is reaching the bowel without problems the trouble is clearly with evacuation - either because the muscle spasms aren't occurring or have been disrupted in some way, or the stool is too dry and hard or too large to pass.
A 2 inch diameter stool is quite large enough for a young boy to pass.
Pooping is something of an unpleasant and scary process for a young boy. If he passed a hard stool sometime and it hurt it will be quite frightening and he will resist the urge to go - ignoring the pressure on his anus and the muscle spasms that cause it, sometimes managing to over-ride the natural urge to defecate altogether...
Routine is important to establish a body clock - encouraging him to have a hot drink and some breakfast each morning and then sitting on the lavatory for five minutes each day even if he doesn't need to go will be a beginning and might help dispel any fears he has, especially if you lead by example...
The right diet should mean hard and uncomfortable stools are a thing of the past but just in case you could lubricate his anus with some petroleum jelly to aid the passage and decrease any fear he might have!
Explaining as well as you can how the digestive system works can't do any harm and telling him he is hurting his body if he resists the urge to go too much might also be good.
Including some senna tea in his bedtime drink might also help establish that all-important routine - it is a quite natural aid to good bowel habits and has been used for centuries...
Avoiding anti-spasmodics is also good. Peppermint is one of several common things that has that effect.
I feel the underlying cause is fear of pain and discomfort and/or of lavatories (not unusual) and this has resulted in the disruption or suppression of the natural bowel spasms...
I wish you good luck...