Firstly, when practicing kihon or kata, in their solo forms of training, one needs to maintain constant awareness: of their surroundings/opponent(s). This takes immense mental discipline, but in time, becomes second nature.
Secondly, when practicing jiyu-kumite don’t only focus on your opponent, but what’s around you—be ready for anything. Likewise, in the case of yakusoku-kumite (prearranged sparring), don’t concentrate on the `announced attack’ but rather be ready for a mawashi-zuki (roundhouse punch); someone applying a shimewaza (strangulation technique) from behind; a rugby tackle; a gedan mae-geri instead of a jodan oi-zuki, etc... As emphasized before, this ultimately becomes a concerted effort that one consciously undertakes in every moment of one’s training.
By and large, `keeping your radar switched on’ becomes just like other fundamental skills, such as using your hips when you perform techniques or not changing height (during steps, turns and stance transitions).