Formation of the widest binary stars from dynamical unfolding of triple systems