Parametrize generic codec over internal label/observation types