Heavy-flavor anisotropic flow at RHIC and LHC energies within a full transport approach