As you know there are two protocols. Event base protocols and Query base protocols. SNMP traps belong to event base protocol. Trap are self-generated due some type of event taking place.
But how to create a such situation in lab environment for learning purpose that is easy if you have the basic resources and know how to setup a network environment. Have an host machine, create three Virtual machine ( VMware)
Use your host machine as monitoring and use the two or three machines you created has devices. Start playing with memory setting. Alert will be trigger as Traps