Due to the elastic nature of the cloud environments, migration of the legacy software systems to the cloud has become a very attractive solution for service providers. To provide Software-as-a-Service (SaaS), an application provider has to migrate his software to the cloud infrastructure. The most challenging issue in the migration process is minimizing the cloud infrastructure (VM's) costs while preserving the quality requirements of the service consumers. In this paper a self-adaptive method for migrated applications to the cloud is proposed in which an intelligent auto-scaling component continuously monitors the incoming application workloads and performs vertical or horizontal scaling. Since reacting to the transient workload changes always results in useless sequences of ``acquire-release'' actions of cloud resources and imposes unwanted overhead costs on the service provider, the auto-scaling component recognizes the transient workloads using a Learning Automata and only reacts to the stable ones. The OpenStack platform is used for evaluating the applicability of proposed method in real cloud environments. The experimental results demonstrate the ability of the proposed method in recognizing the transient workloads and consequently reducing the overall costs of the service provider.