Investors are checking out of retail with the sector on track to post its worst quarter since the financial crisis, and one top technician says Costco could be the next victim of the sell-off.

Shares of the big-box retailer are up nearly 19 percent year to date, compared with a more than 4 percent drop in the broader XRT ETF, which tracks the retail sector. According to Carter Worth, head of technical analysis at Cornerstone Macro, there's even more pain ahead.

After hitting a fresh all-time high of $54.50 back in August, the XRT ETF has now fallen more than 17 percent. Worth's charting reveals that the moves of late have created a bearish head-and-shoulders formation, implying the ETF could be poised to fall below a key $44 level.

"We're right back to these prior lows, which is also support until it's not, and I think that's what we're setting up for," Worth explained Friday on CNBC's "Options Action." "We're going to actually break the trendline and break below these well-defined 52-week lows."

While shares of Costco have been able to buck the trend in the broader retail space this year, Worth believes the stock's recent inability to break above its own upward trend line suggests there could be pain ahead.

"When you get back to the underbelly of the line where it failed, that's deadly," he said. "I think this is the opportunity; Costco has held up too well, and I think it ultimately will break down."

Shares of Costco are now down more than 9 percent from its 52-week closing high of $244.21 in September.

Additionally, Worth noted how Costco's consolidation after a steep move lower has established a diamond formation — suggesting that shares of the retailer are setting up to break below both its upward trend line and downside resistance in the near-term and "implies as much as [a] 10 percent move lower."

"I think you get out of Costco if you're long going into earnings," Worth cautioned.

Costco is set to report first-quarter earnings this Thursday and was trading lower on Monday afternoon around $220.70.