Tell me if I am wrong:
you have to put a gram soulgem (empty or with soul ???) on an altar, then cast a soul capture spell on it.
Well, I've tried, with soulgem on the altar, in the altar... can't transform it...

Maybe someone know the player.additem code ?