Extraction of heavy-flavor transport coefficients in QCD matter