I don't really think it takes any trick, you just need to learn your babies temperment and signals which takes a little time.
For us, we put my daughter in her crib from the day we brought her home from the hospital. Whenever she fell asleep, she went in the crib. That is not to say we never held her - babies need to be held a lot and of course we wanted to. But we let her nap in there and always go in there at night. We never had to deal with the transition because she always knew tha twas her room and she learned to sleep well in our arms and in her bed. I genuinely believe it is safer than having her in your bed.
Let your baby fall asleep and place her in there while you nap, shower, eat, or do housework. My second daughter used the swing for her naps for awhile, but she went into the crib easily when she started her regular nap schedule around 3 months.