A cognitive transition underlying both technological and social aspects of cumulative culture