Electron and photon energy calibration with the ATLAS detector using 2015–2016 LHC proton-proton collision data