Heavy quark form factors at two loops