Item containers may have a entity source or a player source, it should be obtainable by ItemContainer.entitySource
if I remember right. From there you can get the transform of the entity.
As for Items, they don't have a transform unless they're dropped, in which they're turned into a DroppedItem, instead of Item.