If you are in-game then it's simple to see this graphically. While on the bridge, use your binos or the bridge target bino and look at the readout in degrees in the top of the screen. You'll see when you are looking at the bow it's always 0 and the stern is always 180 etc. The binos are set up with the relative bearing indicated. Now have a look at your compass dial in the bottom right of your screen. That's your course/direction relative to north and obviously doesn't always correspond to your relative bearing info.
As I'm Going Down has stated, it doesn't really matter initially what course you are on when you hear one of your crew yell "ship (or aircraft) spotted, bearing XXX degrees" as that yelled bearing is always relative to your bow/stern centerline. This goes for your sonar guy too when he says "Merchant, bearing xxx, medium speed, long distance, moving away!" etc. The trick is to determine what your target's true course is, albeit roughly at first, so you can initially head in the right general direction and get more info/data which will firm up your plan of intercept/attack. Surface radar later in the war helps with this a lot.