Linking through time: memory-enhanced community discovery in temporal networks