Unraveling intricate processes of glassy dynamics from static structure by machine learning relative motion