Find \left(\log _{2} x\right)^{2} if \log _{2}\left(\log _{8} x\right)=\log _{8}\left(\log _{2} x\right).