From Transportation management > Setup > Engines > Rate engines, you need to select the rate engine and click Parameters. You then need to define a parameter for the mileage engine.
For example, if you look under the P2PMileage engine that is standard, the MileageEngineCode parameter is used as an example:

If this has been added and you are still having issues, you'll need to post the metadata as success of this working is highly dependent on the data being used by the engine.