id You can then use the ref id to un-equip that item from them., but the game will most likely respawn the item the next time you change zones/go through a loading screen.
The only way I know of is to use the 'inv' console command, which will show everything they currently have, including 'hidden' items along with the ref. Some outfits use a different body slot to 'clothing' and 'Armor' so that they can be worn 'under' them without being un-equipped, which is probably why equipping the 'lace underwear' item doesn't place their default outfit into their inventory. 'openactorcontainer 1' does work on Companions, but it merely gives you the default inventory/item swap screen, so it still doesn't show 'hidden' or default items. Use 'DEFUI Iconlibs Rescaled and Fixed' for icons. Not sure if it'll work on companions, but won't hurt to try. Installation notes: Don't install defui (FO4-swf won't work with FO4VR).
You can try opening the console, clicking them and entering 'openactorcontainer 1' without the quotes.