Sri Lanka legend Kumar Sangakkara played one of the finest knocks of his long career at The Oval as Surrey beat Nottinghamshire by four runs.