Adding machine learning within Hamiltonians: Renormalization group transformations, symmetry breaking and restoration