I detail the assertion: "This frees up four degrees of freedom (two constraints each in both boundary regions)" in an example with $2$ knots $\xi_1, \xi_2$.
The related intervals are $]-\infty, \xi_1[$, $]\xi_1, \xi_2[$ and $]\xi_2, +\infty[$ (so there are $|I|=3$ intervals and $|I|-1=2$ knots).
For (common) cubic splines
Without regularity constraints, we have $4|I|=12$ equations:
$$\mathbf{1}(X < \xi_1)~~;~~\mathbf{1}(X < \xi_1)X~~;~~\mathbf{1}(X < \xi_1)X^2~~;~~\mathbf{1}(X < \xi_1)X^3~~;$$
$$\mathbf{1}(\xi_1 \leq X < \xi_2)~~;~~\mathbf{1}(\xi_1 \leq X < \xi_2)X~~;~~\mathbf{1}(\xi_1 \leq X < \xi_2)X^2~~;~~\mathbf{1}(\xi_1 \leq X < \xi_2)X^3~~;$$
$$\mathbf{1}(\xi_2 \leq X)~~;~~\mathbf{1}(\xi_2 \leq X)X~~;~~\mathbf{1}(\xi_2 \leq X)X^2~~;~~\mathbf{1}(\xi_2 \leq X)X^3.$$
By adding the constraints (cubic splines assumes a $\mathcal{C}^r$ regularity with $r=2$ ), we need to add $(r+1)\times(|I|-1) = 3\times(|I|-1) = 6$ constraints on the linear coefficients.
We end up with $12-6=6$ degree of freedom.
For natural cubic splines
"A natural cubic splines adds additional constraints, namely that function is linear beyond the boundary knots."
Without regularity constraints, we have $4|I|-4=12-4$ equations (we have removed $4$ equations, $2$ each in both boundary regions because they involve quadratic and cubic polynomials):
$$\mathbf{1}(X < \xi_1)~~;~~\mathbf{1}(X < \xi_1)X~~;~~$$
$$\mathbf{1}(\xi_1 \leq X < \xi_2)~~;~~\mathbf{1}(\xi_1 \leq X < \xi_2)X~~;~~\mathbf{1}(\xi_1 \leq X < \xi_2)X^2~~;~~\mathbf{1}(\xi_1 \leq X < \xi_2)X^3~~;$$
$$\mathbf{1}(\xi_2 \leq X)~~;~~\mathbf{1}(\xi_2 \leq X)X.$$
The constraints are the same as before, so we still need to add $3\times(|I|-1) = 6$ constraints on the linear coefficients.
We end up with $8-6=2$ degree of freedom.