Comprehensive investigation of the impact of lateral charge migration on retention performance of planar and 3D SONOS devices