When you input a nonlinear function into MOSEK you give MOSEK a C function that can compute the function value, the gradient and Hessian for a given variable vector. MOSEK has no way of knowing how the function compute these values and hence there is no way it can dump such a function to file on a disk. The nonlinear function is simply a black box.