Electron energy loss spectroscopy as a probe of the local atomic environment