Atomic approach to core-level spectroscopy of delocalized systems: Case of ferromagnetic metallic Mn5Ge3