how does this specific line of code work?
#define HRM_FLAG_MASK_HR_VALUE_16BIT (0x01 << 0) /**< Heart Rate Value Format bit. */
That line of code doesn't "work", as such, because it doesn't actually perform any job. It just gives a name to numeric constant.
It is just standard 'C' syntax - nothing specific to ARM or microcontrollers - so you should simply look it up in your 'C' textbook.
Here are some 'C' reference & learning resources - including a free online textbook:
blog.antronics.co.uk/.../