We investigate the electronic properties of stable β-UH3 under high pressure up to 75 GPa within the first-principles DFT + U formalism with pressure-dependent U in a self-consistent calculation, and we find an electronic structure transition at about 20 GPa due to the quantum process of localization and itinerancy for partially filled uranium 5f electrons. The electronic structure transition is examined from four perspectives: magnetization, band structure, density of states, and 5f electron energy. On the basis of the density of states of 5f electrons, we propose an order parameter, namely, the 5f electron energy, to quantify the electronic structure transition under pressure. Analogously to the isostructural transition in 3d systems, β-UH3 retains its magnetic order after the electronic structure transition; however, this is not accompanied by volume collapse at the transition point. Our calculation is helpful for understanding the electronic properties of β-UH3 under high pressure.