I'm not sure about your question, I do know that legal custody only allows the parent to be part of major decisions like medical and schooling issues. Since your son would probably have schooling as a part of his residential treatment, your ex may have some ground to stand on. I would talk to a legal professional or look up the way the law is written and re-read your own personal custody agreement. The other thing you can do is let your chosen facility know about your concerns and ask them to notify you if your ex shows up.
I know you didn't really ask for further advise, so excuse me if this is out of place. I do not have teenagers, my daughters are 2 and 4. I do however, remember the anguish it is to be a teen and I was in a residential treatment facility when I was 15.
It was the best thing that could've happened, going there. A lot of the staff were wonderful, caring people who befriended me. Some of the staff were power hungry jerks, these were the people I learned the most from. I learned how to comunicate with difficult people. I learned how to avoid acting like a difficult person.
All of that aside, the one thing I wish I had gotten from my parent(s) was a heart to heart before I left. I wish they had talked to me just once on an even level, with out them acting as an authority figure. If they could've taken me aside and said how they felt, I wouldn't have felt betrayed. They should have told me they were scared, that I only had one chance to live my life, that they truely couldn't control a damn thing I did and it was all up to me, everything, who I was, what I did, how I felt.
If I had heard all that from them, then, I think it would've been easier for me to heal and change.
There is hope, though, I have a wonderful relationship with my folks now (I'm 24). I tell them everything, they are proud of me as a parent and as a person. I'm sure you and your son will be able to come through this stronger and I hope whatever input your ex has is positive. Good luck!