Spatial and temporal dynamics of cortical networks engaged in memory encoding and retrieval