With recent versions of scikit-learn (e.g. 1.7.1), the answer of @piman314 can be greatly simplified.
def get_activations(mlp, x):
    activations = [x] + [None] * (mlp.n_layers_ - 1)
    activations = mlp._forward_pass(activations)
    return activations