You will have to beat one of the global track records in either qualifying or race. This usually tends to happen shortly after a track is updated or at the end of an Elite season when cars stats are almost maximised*. In terms of beating the race record, you'll most likely have to save up boost and use it during a full lap as well.
Beat the stopwatch - Set a new qualifying or race lap record at any circuit
*or almost always after a Dev test happens and the record needs to be reset