Transferable neural networks for enhanced sampling of protein dynamics