You can be stopped at any time and any place where an officer believes you intend to travel abroad or on your return from travelling abroad.
This includes before security, after security and even when you have boarded the mode of transport which you are using.