Cat Taught to Hug

How do you even teach your cat to do something like this? The little guy gives his owner a big hug!