You can compare the Message Sequence of the current message being processed, against the last sequence number of the message received for a partition. The difference between these numbers is 'how far behind' the latest message your processing has fallen. To get the details of the last message received in a partition, you need to access a PartitionContext object.
How I've implemented this is with Azure Function and a Custom Metric in Application Insights. As a batch of messages is received, I calculate the difference between the values and write the metric, which allows me to track this in Grafana and raise alerts when required.
I wrote a medium article on how to achieve this here - https://medium.com/@dylanm_asos/azure-functions-event-hub-processing-8a3f39d2cd0f