If you're getting killed by behind a bunch then just position yourself further away from the middle of the map. A nice trick I do is you keep track of generally where your teamates are and aren't and assume any large areas without teamates have enemies.
Map spacing is pretty underrated. I can't count the amount of times where I get killed and a green arrow is hugging me from behind and gives the enemy a double kill. If they just spaced out a bit better they'd get a free kill off a guy reloading and/or distracted. Usually when I'm on mid range maps I'll always position myself in between teammates but spaced out far enough where I can react if things go wrong. If you're playing with a party you can use the feed to help map awareness as well since you have a general idea of where each of your teammates are.
Here is what I'm talking about:
This is off the initial rush. Everyone on my team went left so the only way enemies can come in are from the middle or behind me. After I kill this guy I figure the best action is to push up and let my team pinch in behind me so I can watch the radar to see them. Alternatively I could've backtracked but since the score is only 3-0 after I kill the first guy, I know at least 3 other players should be left in mid/right.
After I push into mid I see green arrow is turning back towards bathroom. I'm watching his arrow and the arrow of my teammates on top left. The only way an enemy can engage me at this point is through the side door so that's the only thing I'm watching other than my mini map. If blue arrows die I know people are coming through vending door and if green arrow dies I know the spawn flipped to bathroom.
I get another kill. Look where all my teammates are now. Only direction enemies can hit me from are side door or through bathroom entrance (teammates are too far off the edge to consider it safe)
I decide to backtrack at this point and regroup so I can figure out where everyone is since my screen is so red. I'm also watching the three circled teammates as I move to make sure enemies aren't coming from those directions.
Here I correctly guessed the spawn flip (to bathroom). I think it's somewhat obvious because in the previous screen two of my teammates are all the way back into the ramps spawn and the one on vert is moving that direction as well. I'm also in side door which is closer to ramp than bathroom. From here I can tell if someone is coming into proshop from the stairs or behind me because of the blue arrow. I also know that they're coming from bathroom and if someone kills blue on the left, someone could flank through side door.
Here is an example of "playing it safe". I'm using every single one of my teammates as a meat shield because at this point I've worked myself into a 15 kill streak or something. Basically anyone that dies will inform me of where the enemy is coming from.
I engage an enemy in mid but don't kill anything then notice the top left arrow vanishes. Look what happens seconds later:
I always hear people complaining about "HOW DID HE KNOW I WAS COMING THAT DIRECTION" when they're running ghost/silencer/we have no UAV and it's because I'm not a dummy. There are so many clues you can use to let you know where an enemy is coming from. The mini-map is just one way. Watching the kill feed when lighting strike and hellstorms wipe the enemy team will usually let you know when the enemy is spawn flipping in TDM. Another tool is watching where your teammates spawn to spot potential spawn flips or partial flips.