What I took away from this comment thread at Captain Awkward’s and my own thoughts lately:
(1) Become aware of your feelings concerning a boundary violation. Allow yourself to feel them (e.g. get angry, feel helpless).
(2) Tell the person how they make you feel when they do certain thing.
(3) Ask them to do specific thing (usually: stop it, possibly accompanied by a longer explanation how you expect them to act in the future).
(4) If necessary, enforce your boundaries. At first in the moment, with words (or actions, if necessary). When you’ve stated clearly that you are not okay with their behavior and they still do not react accordingly, solely with actions.