Top EU court rules Poland wrongly transferred critical judge