Learning Domain-Independent Heuristics for Grounded and Lifted Planning