I used to have this problem REEEEEEAAAAAAAAALLLLLLLLLYYYYYYY bad.
It depends on the circumstances, but I agree with your T. I have learned that if someone is violating my boundaries it IS OKAY to let them know, respectfully (even if they aren't) that I won't allow it and if necessary walk away. I learned not to violate other people's boundaries by being cognitive of what I would think if the other person was acting like me. I hope that makes sense.
Just like all changes we have to make in our behavior, it takes time and practice, but it does eventually become easier. Now I don't have to be as self-conscious about it as I used to be.
Hope this helps.

WW