Broadband and demon screens are especially useful for that. Try dropping your NB contact and remarking it from BB. If you have more than 6 lines on demon on another submarine, you're way close, especially if you're both heading right at eachother.
Also you should occasionally use your HF sonar even in blue waters, to check if there are any objects around you such as mines, submarines or debris.
If you are in the Kilo you can use your periscope to check if anything is very close to you, but you have to be shallow for that or you'll flood the scope.
Of course the most obvious sign that you're too close is an extremely sudden and major bearing aspect change. That's never good. I have had a few of these myself (Usually in the 'quick generated' missions).