Transfer learning for improved generalizability in causal physics-informed neural networks for beam simulations