Statistical physics of the spatial Prisoner’s Dilemma with memory-aware agents