The grammar structure を境に (をさかいに) is used to express that a particular event or point in time serves as a turning point or dividing line, after which a significant change occurs. The noun さかい境 literally means "boundary" or "border", so を境に conveys the idea that something changed dramatically from that point onward.
It is used to describe life-changing events, historical turning points, or any moment that clearly divides a "before" and "after".
を境にして is a slightly more formal or emphatic variation with the same meaning.
Compare with をきっかけに, which focuses on a trigger or catalyst for something happening. を境に places more emphasis on the idea of a clear dividing line between two distinct states.