Correspondence between quantum operators and classical formulas Background
From what knowledge of quantum mechanics I have so far, it is a postulate that Hermitian operators corresponding to a certain observable act on a quantum state $\psi$ to produce a new quantum state. The eigenstates of these operators are the states with a definite value for the observable and the eigenvalue for each eigenstate is this definite value.
We also know that $\hat{H}$ is the operator corresponding to the energy. This means it should act on a state with definite energy to produce the value of the energy times this state. $\hat{H}$ acting on a general state (not necessarily an energy eigenstate) basically differentiates the state with respect to time (with an $i$ and a $\hbar$ thrown in).
So when solving a problem in QM we could find the energy eigenstates $\psi_{i}$ through the equation $\hat{H} \psi_{i} = E_i \psi_{i}$. We could also find the time evolution of an arbitrary state $\psi$ through the equation $\hat{H} \psi = i\hbar \frac{\partial \psi}{\partial t}$.
Now, the classical Hamiltonian of a particle that is in a potential is $H = \frac{p^2}{2m} +V(x)$. In a few YouTube videos I have seen on solving the Schrodinger equation, they say that this means the Hamiltonian operator for the quantum analog of this system must be $\frac{\hat{p}^2}{2m} + V(x)$ where $\hat{p}$ is the momentum operator. So that means the equation $\hat{H} \psi = i\hbar \frac{\partial \psi}{\partial t}$ turns into $\frac{\hat{p}^2}{2m} \psi + V(x) \psi = i\hbar \frac{\partial \psi}{\partial t}$ which means $ -\frac{\hbar^2}{2m} \frac{\partial ^2 \psi}{\partial x ^2} + V(x) \psi = i\hbar \frac{\partial \psi}{\partial t}$ after substituting for $\hat{p}$
The Question
My question is this:

*

*How do we justify (mathematically or using some postulates of quantum or classical mechanics) that we can just replace the $p$s in the classical Hamiltonian formula with $\hat{p}$ operators to get the quantum Hamiltonian operator $\hat{H}$?

Edit 1:
I now understand the derivation of the momentum operator as the generator for translation. So I removed that from my question.
 A: Your derivation looks fine for me and is known as translation operator in literature(https://en.wikipedia.org/wiki/Translation_operator_(quantum_mechanics) and various books on quantum mechanics(QM)). You can think about $\hat{V}(\epsilon)$ as an unitary transformation in space, but as far as I know, this has no application apart from deriving stuff for $\hat{X}/\hat{P}$. The idea of defining an infinitesimal unitary operator $$\hat{V}(\epsilon)=1-\frac{i}{\hbar}\epsilon \hat{G}$$ with hermitean $\hat{G}$ is actually an often used approach in QM and QFT(Lie groups: $\hat{V}(\epsilon)$ is an element of a Lie group and $\hat{G}$ is an element of the corresponding Lie Algebra) and can also be applied to angular momentum, the third basic operator in QM besides $\hat{X}$/$\hat{P}$ and $\hat{H}$.
By the way, I am confused about the sign in $\hat{V}(\epsilon)=1+\frac{i}{\hbar}\hat{p}\epsilon$. I know the version with $-$ from literature, but this gives the right result here...
Short answer for the main question: One defines the operators $\hat{X},\hat{P}$ that appear in $\hat{H}$ to correspond to classical quantities. As a consequence, the appearance of operators $\hat{X}$, $\hat{P}$ in the operator $\hat{H}$ has the same form as the appearence of $x, p$ in the classical $H$.
Long answer: Using just the postulates of QM, one has elements of a Hilbert space describing physical states and hermitean operators describing observables(measurable quantities) that operate on these states. Now, the challenge is to define some operators that describe the observables that we know from classical physics. Since the classical Hamiltonian depends only on the variables $x, p$, it should be sufficient to define two corresponding operators $\hat{X}, \hat{P}$ that behave like one expects for a position operator and a momentum operator. It turns out that $[\hat{X},\hat{P}]=i\hbar$ is a good definition(see literature for argumentation). Furthermore, one can generalize the idea of orbital angular momentum $\vec{L}=\vec{x}\times\vec{p}$ to the angular momentum operator $\vec{J}$ defined by $[J_i,J_j]=i\hbar\epsilon_{ijk}J_k$. To my extend, this is all one needs for QM.
After looking at how the elements of the Hamilton operator $\hat{H}$ are defined, one expects that $H$ and $\hat{H}$ have the same form. This is just a consequence of useful definitions for the operators $\hat{X}$, $\hat{P}$.
There is one subtlety for the rule "replace classical quantity with operator": $\hat{H}$ has to be hermitean, but you can build non-hermitean things out of the hermitean $\hat{X}, \hat{P}$. For example $\left( \hat{X}\hat{P}\right)^\dagger = \hat{P}^\dagger \hat{X}^\dagger = \hat{P}\hat{X} = \hat{X}\hat{P}-i\hbar \neq \hat{X}\hat{P}$.
In such cases, one has to symmetrize the expression to make it hermitean, here $\hat{X}\hat{P}\to \frac{1}{2}\left( \hat{X}\hat{P}+\hat{P}\hat{X}\right)$.
A: I watched a few videos on YouTube on the Hamiltonian formulation of classical mechanics and how the Poisson bracket in it relates to the commutator in quantum mechanics. Here's what I found on the difference between a classical and quantum system and how we can somewhat mathematically justify the replacement of classical functions by operators:
Classical Mechanics
A classical system is defined by a phase space, which is a space of points $(q_i, p_i)$, as well as a function $H(q_i,p_i)$ on the phase space called the Hamiltonian which basically gives you the energy of a particular point in phase space.
There is also an operation called a Poisson bracket $\{, \}$ associated with a classical system which is a way of taking two functions on the phase space and forming a sort of "commutator" or relation between them.
Quantum Mechanics
A quantum system is defined by a Hilbert space which is a space of state vectors $|\psi\rangle$. Classical functions on phase space $f(q_i,p_i)$ are replaced by  operators $\hat{f} |\psi\rangle$ which act on quantum states. So, for example, the functions on phase space $x$ and $p$ are replaced by operators $\hat{x}|\psi\rangle = x|\psi\rangle$ and $\hat{p}|\psi\rangle = -i\hbar \frac{\partial |\psi\rangle}{\partial x}$.
We also want these operators to satisfy the condition that the commutator between them $[ , ] = i\hbar \{ , \}$ which is $i\hbar$ times the Poisson bracket between the classical variables corresponding to them. So $[\hat{x}, \hat{p}] = i\hbar \{x, p\} = i\hbar$
This mathematically preserves the structure of classical mechanics while also replacing phase space with Hilbert Space.
As this answer says:

... every time we say "here is something classical" and "here is something quantum" the move from classical to quantum is never a derivation. It might be clearer to say "here is something quantum" first, and then add "look, it has a similar overall structure to this classical equation, so the classical equation helps us on our journey into understanding the quantum one, and it can act as a mnemonic too."

