It's called a resistor, Robert Teasing aside, you simply choose a value such that there is a volt drop you can measure across the shunt resistor that is still small enough to not impact your circuit when the maximum current is flowing.

Unfortunately with a PWM it's more complicated to figure out what that voltage equivalence really is - first because it's AC, but worse it is a square wave and might be changing a bit fast for the PIC ADC can follow. I'd think along the lines of a shunt resistor with a differential amplifier (op-amp) sensing across it, that charges or discharges a capacitor through a resistor, which is then measured with the ADC. Choose values based on response time needed; fast enough to limit the time the answer is wrong, but slow enough the PIC can follow it. The voltage will be directly proportional to the average current after about 5 time constants.