In most of the cases, the Hamiltonian is equal to the total mechanical energy, which is usually conserved. They are equal and conserved when the potential energy is not dependent on velocity and there is no explicit time dependence. So at each point on the path, particle has the same total energy which is $H$ as well.
In a previous question/answer, we derived:
$$H = E = \frac{\partial S}{\partial t_1} = -\frac{\partial S}{\partial t_2}.$$
This is clear, but my book says:
$$H = -\frac{\partial S}{\partial t}\tag{1.4}$$ $$E = -\frac{\partial S}{\partial t}.\tag{1.6}$$ Note here that we're doing with respect to $t$ and not the initial or final point.
Where did we get this from rigorously?