To display document categories for each item/document in a transformation, you need to implement your own function to the transformation and you need to call it with the DocumentID parameter:
DataSet ds = CMS.SiteProvider.CategoryInfoProvider.GetCategories("CategoryID IN (SELECT CategoryID FROM CMS_DocumentCategory WHERE DocumentID = " + docID + ")", null);
Now, you can just return categories from the dataset as a string with your required formatting.
-jh-