This is called momentum ignition, and it is illegal. Any "manipulative" behaviour is illegal. I quote the SEC:
Manipulation is intentional conduct designed to deceive investors by controlling or artificially affecting the market for a security. Manipulation can involve a number of techniques to affect the supply of, or demand for, a stock. They include: spreading false or misleading information about a company; improperly limiting the number of publicly-available shares; or rigging quotes, prices or trades to create a false or deceptive picture of the demand for a security. Those who engage in manipulation are subject to various civil and criminal sanctions.
Layering or spoofing is another thing entirely, and is also illegal but harder to prove orders are non-bonafide unless the behaviour is egregious. These behaviours rely on creating a false sense of size on one side of the market to push it towards passive orders resting on another side of the market. For example, let's say I bid 15.00 and offer 15.01. If my 15.00 bid gets hit I then bid extreme size at 14.99 to give the impression of a large buying interest. Other participants tick the market higher, lifting my 15.01 offer. This is illegal because my order(s) at 14.99 are not "bonafide" as I don't intend to actually buy, but am instead trying to trick other participants to move the market higher.
Your example is momentum ignition because you hope others will follow you higher so that you can sell the stock back to them. It does you no good to buy up all the stock between say, 15.00 and 15.05, if no bids follow behind you so that you can sell back to them at a price greater than your cost basis.
Here is an example of enforcement action against layer/spoofing: https://www.sec.gov/News/PressRelease/Detail/PressRelease/1365171484972.