A Functional-Space Mean-Field Theory of Partially-Trained Three-Layer Neural Networks