Measurement of flow harmonics correlations with mean transverse momentum in lead–lead and proton–lead collisions at \(\sqrt{s_{\mathrm{NN}}} = 5.02~\hbox {TeV}\) with the ATLAS detector