How can I find a relative yaw value from an IMU (MPU-6050) based on which direction is currently up?
Jeff Roberg (author of I2CDev) has done a pretty good job with his MPU6050 library. Note that, pitch and roll are absolute values when you calculate them from the accelerometer values, but Yaw is relative as there is no Magnetometer in MPU6050.

When you power up the MPU6050, it will always start counting the yaw value from 0 or so degrees (range: 0 - 360 degrees), and then there will be some drift happening. But, the pitch and roll values will always be absolute in the range of -90 to +90 degrees.

If you want to calculate the orientation, don't follow yaw value!
Use a combination of the 'gravity' component and the 'pitch' or 'roll' component.