Spacelike and timelike form factors for the $(\pi^0,\eta,\eta')\to\gamma^*\gamma$ transitions in the light-front quark model