Leveraging Hamilton-Jacobi PDEs with time-dependent Hamiltonians for continual scientific machine learning