Was wondering the same thing… Solved it like this:
const TSharedPtr<SWidget> CurrentWidget = WidgetsUnderCursor.Widgets[WidgetIndex].Pin();
if (CurrentWidget.IsValid() && CurrentWidget->GetType() == "SObjectWidget")
{
TSharedPtr<SObjectWidget> ObjectWidget = StaticCastSharedPtr<SObjectWidget, SWidget>(CurrentWidget);
UserWidgetsUnderCursor.Add(ObjectWidget->GetWidgetObject());
}