Active Representation Learning for General Task Space with Applications in Robotics