The only way is to save in your device internally for each message time stamp, when you last received it.
If you mean my NMEA2000 library SetN2kTrueHeading function that actually calls SetN2kPGN127250 with all parameters by setting deviation and variation to NA and reference to N2khr_true.
If you read heading from bus ParseN2kHeading you can see in header file the types:
ParseN2kHeading(const tN2kMsg &N2kMsg, unsigned char &SID, double &Heading, double &Deviation, double &Variation, tN2kHeadingReference &ref)
So reference type is enum tN2kHeadingReference. See example DataDisplay2 and function
void Heading(const tN2kMsg &N2kMsg)
You must handle reference variable so that you know is sent andle true or magnetic.