The velocity update function in Particle Swarm Optimization (PSO) governs the movement of particles and significantly impacts algorithm performance. Numerous variants of the PSO velocity update function have been proposed, ranging from manually designed rules based on heuristic modifications to functions evolved through evolutionary algorithms. Among the latter, approaches based on Genetic Programming (GP) have been used to generate symbolic velocity expressions. However, most existing GP-based methods focus on optimizing performance on specific benchmark functions, with limited emphasis on generalization. This paper introduces a method for evolving velocity update functions using tree-based GP, with a focus on generalization across heterogeneous optimization problems. Each GP individual represents a velocity function that maps particle-level and swarm-level descriptors to a velocity vector. Experiments are conducted on shifted and rotated functions from the CEC 2005 benchmark suite across varying dimensionalities and evaluated on a different set of benchmark functions. Results indicate that evolved functions can outperform the standard PSO update rule and generalize to previously unseen problems and on different dimensionalities. Furthermore, the best evolved solutions share common structures and dynamic behaviors.