The lock system is perfect for those players that don't want to share or sell Pokémon. With this 'Lock' the Pokémon get stuck on your character, unable to be sold or thrown away for a certain period of time.
The number of days is set to your choice, you can choose from 1 to 90 days.
To do lock, go to NPC Yami in Saffron, place the desired Pokémon in the Pokémon menu, and do the following dialogue:
'hi, lock, 30 (number of days)'