Memory effect of Mn$_5$Ge$_3$ nanomagnets embedded inside a Mn-diluted Ge matrix