Following a sales slowdown that lasted for most of 2016, Costco Wholesale (COST -0.40%) has come roaring back this year. Comp-sales growth has been accelerating in recent months, culminating in a double-digit gain during November.

Some of this comp-sales growth stems from relatively inconsequential factors, such as higher gasoline prices and a slightly weaker U.S. dollar. However, customer traffic has also improved significantly in recent months. Last week, Costco reported that it successfully capitalized on this organic sales growth to deliver a strong double-digit increase in EPS in the first quarter of fiscal 2018.

Strong sales throughout the quarter

Costco is one of the few retailers that still reports its sales every month. As a result, investors have known for a while that the discount warehouse giant knocked it out of the park last quarter.

The front entrance of a Costco warehouse

Costco reported strong sales growth in each of the past few months. Image source: Costco Wholesale.

In September, Costco's adjusted comp sales increased 6.2% year over year. (The adjustments strip out currency fluctuations and changes in gasoline prices.) Adjusted comp sales then rose 5.6% in October and 7.9% in November.

For the full first quarter, which included September, October, and most of November, adjusted comp sales rose 7.9%, including a 1.3 percentage point benefit from the timing of Thanksgiving relative to the end of the fiscal quarter. This helped Costco generate revenue of $31.8 billion last quarter, up 13.2% from $28.1 billion a year earlier.

Cashing in on stellar sales growth

During much of fiscal 2017, Costco faced modest margin pressure (excluding one-time items). By contrast, Costco's strong sales growth last quarter helped it to leverage its operating expenses. Meanwhile, membership fee growth is starting to accelerate, due to a fee increase implemented back in June for the U.S. and Canada. These two factors combined to drive margin expansion last quarter.

Adjusted earnings per share reached $1.36 in the first quarter, compared to $1.17 a year earlier. That's a solid 16% increase. (These figures exclude a tax benefit Costco received last quarter, as well as a legal settlement gain that it reported in the prior-year period.)

To be fair, a calendar fluke that caused Thanksgiving weekend to fall during the recently ended quarter -- compared to the second quarter last year -- gave Costco's profit margin an extra boost last quarter. Nevertheless, investors can probably expect continued margin expansion during the remainder of fiscal 2018.

The benefit from higher membership fees will grow

Last quarter, Costco's membership fee income rose to $692 million from $630 million a year earlier. About $18 million of that $62 million increase can be attributed to Costco's membership fee increases in the U.S. and Canada. The rest was driven by growth in the membership base, an increase in the number of members paying for the more expensive "executive" membership, membership fee increases in other international markets, and currency effects.

However, in the long run, Costco's membership fee increase in the U.S. and Canada should drive about $250 million of incremental fee income on an annual basis. In other words, during Q1, Costco only captured a fraction of the gains it will ultimately reap from the membership fee increase. (This has to do with the accounting policies that govern Costco's fee income.)

In the next few quarters, the growth rate for Costco's membership fee income will accelerate. Given that these fees routinely account for close to 75% of Costco's operating income, this should virtually guarantee strong EPS growth during the remainder of fiscal 2018.

Costco will also benefit from a lower tax rate going forward, assuming that Congress passes its tax reform bill in the coming days. As a result, the company may be entering a brief period of unprecedented EPS growth. Thus, there's a good reason why Costco shares trade at a lofty valuation of more than 30 times trailing earnings.