Universal Representation of Generalized Convex Functions and their Gradients